﻿using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.MSSQLDAL.TJDAL;
using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Anke.SHManage.Web.Reports
{
    public partial class RepairPrintModeWebForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Data_Binding();
            }
        }

        private void Data_Binding()
        {
            string id = Request.QueryString["ID"];
            string ambulanceCode = Request.QueryString["AmbulanceCode"];
            DateTime startTime = Convert.ToDateTime(Request.QueryString["SendConfirmedTime"]);
            DateTime endTime = Convert.ToDateTime(Request.QueryString["CompletionTime"]);
            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/RepairPrint.rdlc");
            //Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1);
            //Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1);
            //this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed });
            LSDAL dal = new LSDAL();
            DataTable dt1 = dal.Get_TJ_RepairPrint1(id);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_RepairPrint1", dt1));
            DataTable dt2 = dal.Get_TJ_RepairPrint2(ambulanceCode, startTime, endTime);
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_RepairPrint2", dt2));
            this.ReportViewer1.LocalReport.Refresh();
           

      
     

            //    this.ReportViewer1.LocalReport.Refresh();
            //}


        }
    }
}